package com.usian.behavior.controller;

import com.usian.api.behavior.ApBehaviorEntryApi;
import com.usian.behavior.service.ApBehaviorEntryService;
import com.usian.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/entry")
public class ApBehaviorEntryController implements ApBehaviorEntryApi {

    @Autowired
    ApBehaviorEntryService apBehaviorEntryService;

    /**
     * 远程调用用户查询行为实体  接口
     * @param userId
     * @param equipmentId
     * @return
     */
    @GetMapping("/find/{userId}/{equipmentId}")
    @Override
    public ApBehaviorEntry findByUserIdOrEquipmentId(@PathVariable Integer userId,
                                                     @PathVariable Integer equipmentId) {

        return apBehaviorEntryService.findByUserIdOrEquipmentId(userId,equipmentId);
    }
}
